//
//  ZGSHomeCartoonModel.m
//  MapleLeaf
//
//  Created by dllo on 15/11/27.
//  Copyright © 2015年 AntennaBabyTeam. All rights reserved.
//

#import "ZGSHomeCartoonModel.h"

@implementation ZGSHomeCartoonModel
- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"id"]) {
        self.cId = value;
    }
}

- (void)encodeWithCoder:(NSCoder *)aCoder {
    [aCoder encodeObject:self.cId forKey:@"cId"];
    [aCoder encodeObject:self.columnId forKey:@"columnId"];
    [aCoder encodeObject:self.targetId forKey:@"targetId"];
    [aCoder encodeObject:self.typeId forKey:@"typeId"];
    [aCoder encodeObject:self.orderIndex forKey:@"orderIndex"];
    [aCoder encodeObject:self.inInuse forKey:@"inInuse"];
    [aCoder encodeObject:self.updateSize forKey:@"updateSize"];
    [aCoder encodeObject:self.popular forKey:@"popular"];
    [aCoder encodeObject:self.status forKey:@"status"];
    [aCoder encodeObject:self.albumId forKey:@"albumId"];
    [aCoder encodeObject:self.price forKey:@"price"];
    [aCoder encodeObject:self.updateTime forKey:@"updateTime"];
    [aCoder encodeObject:self.commentNum forKey:@"commentNum"];
    
    [aCoder encodeObject:self.pic forKey:@"pic"];
    [aCoder encodeObject:self.name forKey:@"name"];
    [aCoder encodeObject:self.coverPic forKey:@"coverPic"];
    [aCoder encodeObject:self.author forKey:@"author"];
    [aCoder encodeObject:self.authorName forKey:@"authorName"];
    [aCoder encodeObject:self.label forKey:@"label"];
    [aCoder encodeObject:self.descriptions forKey:@"descriptions"];
    
    [aCoder encodeInteger:self.hSet forKey:@"hSet"];
    [aCoder encodeInteger:self.hPage forKey:@"hPage"];
}

- (id)initWithCoder:(NSCoder *)aDecoder {
    self = [super init];
    if (self) {
        self.cId = [aDecoder decodeObjectForKey:@"cId"];
        self.columnId = [aDecoder decodeObjectForKey:@"columnId"];
        self.targetId = [aDecoder decodeObjectForKey:@"targetId"];
        self.typeId = [aDecoder decodeObjectForKey:@"typeId"];
        self.orderIndex = [aDecoder decodeObjectForKey:@"orderIndex"];
        self.inInuse = [aDecoder decodeObjectForKey:@"inInuse"];
        self.updateSize = [aDecoder decodeObjectForKey:@"updateSize"];
        self.popular = [aDecoder decodeObjectForKey:@"popular"];
        self.status = [aDecoder decodeObjectForKey:@"status"];
        self.albumId = [aDecoder decodeObjectForKey:@"albumId"];
        self.price = [aDecoder decodeObjectForKey:@"price"];
        self.updateTime = [aDecoder decodeObjectForKey:@"updateTime"];
        self.commentNum = [aDecoder decodeObjectForKey:@"commentNum"];
        
        self.pic = [aDecoder decodeObjectForKey:@"pic"];
        self.name = [aDecoder decodeObjectForKey:@"name"];
        self.coverPic = [aDecoder decodeObjectForKey:@"coverPic"];
        self.author = [aDecoder decodeObjectForKey:@"author"];
        self.authorName = [aDecoder decodeObjectForKey:@"authorName"];
        self.label = [aDecoder decodeObjectForKey:@"label"];
        self.descriptions = [aDecoder decodeObjectForKey:@"descriptions"];
        
        self.hSet = [aDecoder decodeIntegerForKey:@"hSet"];
        self.hPage = [aDecoder decodeIntegerForKey:@"hPage"];
    }
    return self;
}

@end
